package day09API.stream;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * @author DBX
 * @date 2021/8/26 0026 - 19:09
 */
public class Test01 {
    public static void main(String[] args)throws Exception {
        //导包
        FileInputStream fis = new FileInputStream("File/fos.txt");
        //向复制文件写操作要用文件输出流
        FileOutputStream fos = new FileOutputStream("File/fos_cp.txt");//这里类名拼写也有错误

        int d;
        while ((d = fis.read()) != -1) {
            fos.write(d);//复制过程不能读两次，写一次
        }
        System.out.println("复制完毕!");
        fis.close();
        fos.close();
    }
}
